<?php
	if($_SERVER["REQUEST_METHOD"]=='POST') {
		$title			= strip_tags($_POST['title']);
		$code			= strip_tags($_POST['code']);
		$discount		= strip_tags($_POST['discount']);
		$ip				= getUserIP();

		$sql = "INSERT INTO `tbl_code` (`code_index`, `title`,`code`, `discount`, `ip`, `date` , `status`) VALUES (NULL, '$title', '$code', '$discount', '$ip', NOW() , '1');";
		mysql_query($sql);
		redirect('../');
		exit;
	}
?>